//
//  HWGameCommentInteractMessageProtocol.swift
//  HWanGame
//
//  Created by 王昌健 on 2022/10/24.
//  Copyright © 2022 94Wan. All rights reserved.
//

import UIKit

class HWGameCommentInteractMessageProtocol: NSObject {
    var models:[HWGameCommunityReplyMessageModel]?
    var replyButtonClick:((_:HWGameCommunityReplyMessageModel)->())?
}

extension HWGameCommentInteractMessageProtocol: UITableViewDelegate,UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return models?.count ?? 0
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = HWGameCommentInteractMessageCell.cellWithTableView(tableView)
        cell.model = models?[indexPath.row]
        cell.replyButtonClick = {
            self.replyButtonClick?($0)
        }
        return cell
    }
    
    
}
